package com.netwit.common.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

//@Mapper
//@Repository
public interface CommonMapper {

    @SelectProvider(type = SqlProvider.class, method = "selectSql")
    List<Map<String, Object>> list(Map<String, Object> map);

    @SelectProvider(type = SqlProvider.class, method = "selectSql")
    Map<String, Object> getOne(Map<String, Object> map);

    @SelectProvider(type = SqlProvider.class, method = "selectSql")
    List<Map<String, Object>> query(Map<String, Object> map);

    @InsertProvider(type = SqlProvider.class, method = "insertSql")
    Integer insert(Map<String, Object> map);

    @UpdateProvider(type = SqlProvider.class, method = "updateSql")
    Integer update(Map<String, Object> map);

    @UpdateProvider(type = SqlProvider.class, method = "deleteSql")
    Integer delete(Map<String, Object> map);

    @InsertProvider(type = SqlProvider.class, method = "batchInsertUpdateEntities")
    Integer batchInsertUpdateEntities(@Param("list") List<Object> list, @Param("tableName") String tableName);

    //@UpdateProvider(type = SqlProvider.class, method = "batchInsertUpdateMaps")
    //Integer batchInsertUpdateMaps(@Param("list") List<Object> list, @Param("tableName") String tableName);

    @UpdateProvider(type = SqlProvider.class, method = "batchInsertUpdateMaps")
    Integer batchInsertUpdateMaps(Map<String, Object> map);

}
